package com.card.vault.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.card.vault.dao.UserDAO;
import com.card.vault.domain.user.User;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserDAO userDAO;
	
	@Transactional
	public void saveUser(User user) {
		userDAO.saveUser(user);
	}

	@Transactional
	public List<User> userList() {
		return userDAO.userList();
	}

	@Transactional
	public void removeUser(int id) {
		userDAO.removeUser(id);
	}

	@Transactional
	public User retriveUser(int id) {
		return userDAO.retriveUser(id);
	}

	@Transactional
	public User retriveUser(String name) {
		return userDAO.retriveUser(name);
	}

	@Transactional
	public User findUsersByName(String name) {
		return userDAO.findUsersByName(name);
	}

}